<?php 
	class function_db_global{
		function getJurusan($obj_kode, $obj_pdo){
			$sql = "SELECT * FROM jurusan WHERE kode_jurusan = :kode_jurusan";
			$stmt_get_jurusan = $obj_pdo->prepare($sql);
			$stmt_get_jurusan->execute(array(':kode_jurusan' => $obj_kode));
			$_data_get_jurusan = $stmt_get_jurusan->fetch(PDO::FETCH_OBJ);
			return $_data_get_jurusan;
		}
		
		function getDosenWali($obj_kode, $obj_pdo){
			$sql = "SELECT * FROM dosen WHERE nim_dosen = 
			(SELECT meta_value FROM user_metadata WHERE username = :username AND meta_key = 'dosen_wali' LIMIT 1)";
			$stmtgetDosenWali = $obj_pdo->prepare($sql);
			$stmtgetDosenWali->execute(array(':username' => $obj_kode));
			$_datagetDosenWali = $stmtgetDosenWali->fetch(PDO::FETCH_OBJ);
			return $_datagetDosenWali;
		}
	}	
	
	$function_db = new function_db_global();
	
?>